<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>&lt;GString&gt;: </title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.2">
<link rel="home" href="index.html" title="">
<link rel="up" href="ch01.html" title="GLib">
<link rel="prev" href="re60.html" title="&lt;%GLibSpawnFlags&gt;">
<link rel="next" href="re62.html" title="&lt;%GLibTestFileType&gt;">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
<td><a accesskey="p" href="re60.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="re62.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="id-1.1.62"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>&lt;GString&gt;</h2>
<p>&lt;GString&gt;</p>
</div>
<div class="refsect1">
<a name="id-1.1.62.2"></a><h2>Description</h2>
<p>The GString struct contains the public fields of a GString.</p>
</div>
<div class="refsect1">
<a name="id-1.1.62.3"></a><h2>Functions</h2>
<div class="refsect2">
<a name="id-1.1.62.3.2"></a><h3>append</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:append self val))
</pre></div>
<p>Adds a string onto the end of a <span class="type">GString</span>, expanding
it if necessary.</p>
<div class="refsect3">
<a name="id-1.1.62.3.2.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>a <span class="type">GString</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>val</p></td>
<td class="parameter_description">
<p>the string to append onto the end of <em class="parameter"><code>string</code></em></p>
<p>Passed as <code class="code">val</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.3"></a><h3>append-c</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:append-c self c))
</pre></div>
<p>Adds a byte onto the end of a <span class="type">GString</span>, expanding
it if necessary.</p>
<div class="refsect3">
<a name="id-1.1.62.3.3.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>a <span class="type">GString</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>c</p></td>
<td class="parameter_description">
<p>the byte to append onto the end of <em class="parameter"><code>string</code></em></p>
<p>Passed as <code class="code">c</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.4"></a><h3>append-len</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:append-len self val len))
</pre></div>
<p>Appends <em class="parameter"><code>len</code></em> bytes of <em class="parameter"><code>val</code></em> to <em class="parameter"><code>string</code></em>.
</p>
<p>If <em class="parameter"><code>len</code></em> is positive, <em class="parameter"><code>val</code></em> may contain embedded nuls and need
not be nul-terminated. It is the caller's responsibility to
ensure that <em class="parameter"><code>val</code></em> has at least <em class="parameter"><code>len</code></em> addressable bytes.
</p>
<p>If <em class="parameter"><code>len</code></em> is negative, <em class="parameter"><code>val</code></em> must be nul-terminated and <em class="parameter"><code>len</code></em>
is considered to request the entire string length. This
makes <code class="function">g_string_append_len()</code> equivalent to <code class="function">g_string_append()</code>.</p>
<div class="refsect3">
<a name="id-1.1.62.3.4.6"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>a <span class="type">GString</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>val</p></td>
<td class="parameter_description">
<p>bytes to append</p>
<p>Passed as <code class="code">val</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>len</p></td>
<td class="parameter_description">
<p>number of bytes of <em class="parameter"><code>val</code></em> to use, or -1 for all of <em class="parameter"><code>val</code></em></p>
<p>Passed as <code class="code">len</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.5"></a><h3>append-unichar</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:append-unichar self wc))
</pre></div>
<p>Converts a Unicode character into UTF-8, and appends it
to the string.</p>
<div class="refsect3">
<a name="id-1.1.62.3.5.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>a <span class="type">GString</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>wc</p></td>
<td class="parameter_description">
<p>a Unicode character</p>
<p>Passed as <code class="code">wc</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.6"></a><h3>append-uri-escaped</h3>
<div class="informalexample"><pre class="programlisting">(define-values
  (%return)
  (string:append-uri-escaped self unescaped reserved-chars-allowed allow-utf8))
</pre></div>
<p>Appends <em class="parameter"><code>unescaped</code></em> to <em class="parameter"><code>string</code></em>, escaping any characters that
are reserved in URIs using URI-style escape sequences.</p>
<div class="refsect3">
<a name="id-1.1.62.3.6.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>a <span class="type">GString</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>unescaped</p></td>
<td class="parameter_description">
<p>a string</p>
<p>Passed as <code class="code">unescaped</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>reserved_chars_allowed</p></td>
<td class="parameter_description">
<p>a string of reserved characters allowed
    to be used, or <code class="constant">NULL</code></p>
<p>Passed as <code class="code">reserved-chars-allowed</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>allow_utf8</p></td>
<td class="parameter_description">
<p>set <code class="constant">TRUE</code> if the escaped string may include UTF8 characters</p>
<p>Passed as <code class="code">allow-utf8</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.7"></a><h3>ascii-down</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:ascii-down self))
</pre></div>
<p>Converts all uppercase ASCII letters to lowercase ASCII letters.</p>
<div class="refsect3">
<a name="id-1.1.62.3.7.4"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>a GString</p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.8"></a><h3>ascii-up</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:ascii-up self))
</pre></div>
<p>Converts all lowercase ASCII letters to uppercase ASCII letters.</p>
<div class="refsect3">
<a name="id-1.1.62.3.8.4"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>a GString</p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.9"></a><h3>assign</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:assign self rval))
</pre></div>
<p>Copies the bytes from a string into a <span class="type">GString</span>,
destroying any previous contents. It is rather like
the standard <code class="function">strcpy()</code> function, except that you do not
have to worry about having enough space to copy the string.</p>
<div class="refsect3">
<a name="id-1.1.62.3.9.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>the destination <span class="type">GString</span>. Its current contents
         are destroyed.</p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>rval</p></td>
<td class="parameter_description">
<p>the string to copy into <em class="parameter"><code>string</code></em></p>
<p>Passed as <code class="code">rval</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.10"></a><h3>down</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:down self))
</pre></div>
<p>Converts a <span class="type">GString</span> to lowercase.</p>
<div class="refsect3">
<a name="id-1.1.62.3.10.4"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>a <span class="type">GString</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.11"></a><h3>equal?</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:equal? self v2))
</pre></div>
<p>Compares two strings for equality, returning <code class="constant">TRUE</code> if they are equal.
For use with <span class="type">GHashTable</span>.</p>
<div class="refsect3">
<a name="id-1.1.62.3.11.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>v</p></td>
<td class="parameter_description">
<p>a <span class="type">GString</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>v2</p></td>
<td class="parameter_description">
<p>another <span class="type">GString</span></p>
<p>Passed as <code class="code">v2</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.12"></a><h3>erase</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:erase self pos len))
</pre></div>
<p>Removes <em class="parameter"><code>len</code></em> bytes from a <span class="type">GString</span>, starting at position <em class="parameter"><code>pos</code></em>.
The rest of the <span class="type">GString</span> is shifted down to fill the gap.</p>
<div class="refsect3">
<a name="id-1.1.62.3.12.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>a <span class="type">GString</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>pos</p></td>
<td class="parameter_description">
<p>the position of the content to remove</p>
<p>Passed as <code class="code">pos</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>len</p></td>
<td class="parameter_description">
<p>the number of bytes to remove, or -1 to remove all
      following bytes</p>
<p>Passed as <code class="code">len</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.13"></a><h3>free</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:free self free-segment))
</pre></div>
<p>Frees the memory allocated for the <span class="type">GString</span>.
If <em class="parameter"><code>free_segment</code></em> is <code class="constant">TRUE</code> it also frees the character data.  If
it's <code class="constant">FALSE</code>, the caller gains ownership of the buffer and must
free it after use with <code class="function">g_free()</code>.</p>
<div class="refsect3">
<a name="id-1.1.62.3.13.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>a <span class="type">GString</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>free_segment</p></td>
<td class="parameter_description">
<p>if <code class="constant">TRUE</code>, the actual character data is freed as well</p>
<p>Passed as <code class="code">free-segment</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.14"></a><h3>free-to-bytes</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:free-to-bytes self))
</pre></div>
<p>Transfers ownership of the contents of <em class="parameter"><code>string</code></em> to a newly allocated
<span class="type">GBytes</span>.  The <span class="type">GString</span> structure itself is deallocated, and it is
therefore invalid to use <em class="parameter"><code>string</code></em> after invoking this function.
</p>
<p>Note that while <span class="type">GString</span> ensures that its buffer always has a
trailing nul character (not reflected in its "len"), the returned
<span class="type">GBytes</span> does not include this extra nul; i.e. it has length exactly
equal to the "len" member.</p>
<div class="refsect3">
<a name="id-1.1.62.3.14.5"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>a <span class="type">GString</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.15"></a><h3>hash</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:hash self))
</pre></div>
<p>Creates a hash code for <em class="parameter"><code>str</code></em>; for use with <span class="type">GHashTable</span>.</p>
<div class="refsect3">
<a name="id-1.1.62.3.15.4"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>str</p></td>
<td class="parameter_description">
<p>a string to hash</p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.16"></a><h3>insert</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:insert self pos val))
</pre></div>
<p>Inserts a copy of a string into a <span class="type">GString</span>,
expanding it if necessary.</p>
<div class="refsect3">
<a name="id-1.1.62.3.16.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>a <span class="type">GString</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>pos</p></td>
<td class="parameter_description">
<p>the position to insert the copy of the string</p>
<p>Passed as <code class="code">pos</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>val</p></td>
<td class="parameter_description">
<p>the string to insert</p>
<p>Passed as <code class="code">val</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.17"></a><h3>insert-c</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:insert-c self pos c))
</pre></div>
<p>Inserts a byte into a <span class="type">GString</span>, expanding it if necessary.</p>
<div class="refsect3">
<a name="id-1.1.62.3.17.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>a <span class="type">GString</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>pos</p></td>
<td class="parameter_description">
<p>the position to insert the byte</p>
<p>Passed as <code class="code">pos</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>c</p></td>
<td class="parameter_description">
<p>the byte to insert</p>
<p>Passed as <code class="code">c</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.18"></a><h3>insert-len</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:insert-len self pos val len))
</pre></div>
<p>Inserts <em class="parameter"><code>len</code></em> bytes of <em class="parameter"><code>val</code></em> into <em class="parameter"><code>string</code></em> at <em class="parameter"><code>pos</code></em>.
</p>
<p>If <em class="parameter"><code>len</code></em> is positive, <em class="parameter"><code>val</code></em> may contain embedded nuls and need
not be nul-terminated. It is the caller's responsibility to
ensure that <em class="parameter"><code>val</code></em> has at least <em class="parameter"><code>len</code></em> addressable bytes.
</p>
<p>If <em class="parameter"><code>len</code></em> is negative, <em class="parameter"><code>val</code></em> must be nul-terminated and <em class="parameter"><code>len</code></em>
is considered to request the entire string length.
</p>
<p>If <em class="parameter"><code>pos</code></em> is -1, bytes are inserted at the end of the string.</p>
<div class="refsect3">
<a name="id-1.1.62.3.18.7"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>a <span class="type">GString</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>pos</p></td>
<td class="parameter_description">
<p>position in <em class="parameter"><code>string</code></em> where insertion should
      happen, or -1 for at the end</p>
<p>Passed as <code class="code">pos</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>val</p></td>
<td class="parameter_description">
<p>bytes to insert</p>
<p>Passed as <code class="code">val</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>len</p></td>
<td class="parameter_description">
<p>number of bytes of <em class="parameter"><code>val</code></em> to insert, or -1 for all of <em class="parameter"><code>val</code></em></p>
<p>Passed as <code class="code">len</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.19"></a><h3>insert-unichar</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:insert-unichar self pos wc))
</pre></div>
<p>Converts a Unicode character into UTF-8, and insert it
into the string at the given position.</p>
<div class="refsect3">
<a name="id-1.1.62.3.19.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>a <span class="type">GString</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>pos</p></td>
<td class="parameter_description">
<p>the position at which to insert character, or -1
    to append at the end of the string</p>
<p>Passed as <code class="code">pos</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>wc</p></td>
<td class="parameter_description">
<p>a Unicode character</p>
<p>Passed as <code class="code">wc</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.20"></a><h3>overwrite</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:overwrite self pos val))
</pre></div>
<p>Overwrites part of a string, lengthening it if necessary.</p>
<div class="refsect3">
<a name="id-1.1.62.3.20.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>a <span class="type">GString</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>pos</p></td>
<td class="parameter_description">
<p>the position at which to start overwriting</p>
<p>Passed as <code class="code">pos</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>val</p></td>
<td class="parameter_description">
<p>the string that will overwrite the <em class="parameter"><code>string</code></em> starting at <em class="parameter"><code>pos</code></em></p>
<p>Passed as <code class="code">val</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.21"></a><h3>overwrite-len</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:overwrite-len self pos val len))
</pre></div>
<p>Overwrites part of a string, lengthening it if necessary.
This function will work with embedded nuls.</p>
<div class="refsect3">
<a name="id-1.1.62.3.21.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>a <span class="type">GString</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>pos</p></td>
<td class="parameter_description">
<p>the position at which to start overwriting</p>
<p>Passed as <code class="code">pos</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>val</p></td>
<td class="parameter_description">
<p>the string that will overwrite the <em class="parameter"><code>string</code></em> starting at <em class="parameter"><code>pos</code></em></p>
<p>Passed as <code class="code">val</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>len</p></td>
<td class="parameter_description">
<p>the number of bytes to write from <em class="parameter"><code>val</code></em></p>
<p>Passed as <code class="code">len</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.22"></a><h3>prepend</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:prepend self val))
</pre></div>
<p>Adds a string on to the start of a <span class="type">GString</span>,
expanding it if necessary.</p>
<div class="refsect3">
<a name="id-1.1.62.3.22.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>a <span class="type">GString</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>val</p></td>
<td class="parameter_description">
<p>the string to prepend on the start of <em class="parameter"><code>string</code></em></p>
<p>Passed as <code class="code">val</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.23"></a><h3>prepend-c</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:prepend-c self c))
</pre></div>
<p>Adds a byte onto the start of a <span class="type">GString</span>,
expanding it if necessary.</p>
<div class="refsect3">
<a name="id-1.1.62.3.23.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>a <span class="type">GString</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>c</p></td>
<td class="parameter_description">
<p>the byte to prepend on the start of the <span class="type">GString</span></p>
<p>Passed as <code class="code">c</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.24"></a><h3>prepend-len</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:prepend-len self val len))
</pre></div>
<p>Prepends <em class="parameter"><code>len</code></em> bytes of <em class="parameter"><code>val</code></em> to <em class="parameter"><code>string</code></em>.
</p>
<p>If <em class="parameter"><code>len</code></em> is positive, <em class="parameter"><code>val</code></em> may contain embedded nuls and need
not be nul-terminated. It is the caller's responsibility to
ensure that <em class="parameter"><code>val</code></em> has at least <em class="parameter"><code>len</code></em> addressable bytes.
</p>
<p>If <em class="parameter"><code>len</code></em> is negative, <em class="parameter"><code>val</code></em> must be nul-terminated and <em class="parameter"><code>len</code></em>
is considered to request the entire string length. This
makes <code class="function">g_string_prepend_len()</code> equivalent to <code class="function">g_string_prepend()</code>.</p>
<div class="refsect3">
<a name="id-1.1.62.3.24.6"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>a <span class="type">GString</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>val</p></td>
<td class="parameter_description">
<p>bytes to prepend</p>
<p>Passed as <code class="code">val</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>len</p></td>
<td class="parameter_description">
<p>number of bytes in <em class="parameter"><code>val</code></em> to prepend, or -1 for all of <em class="parameter"><code>val</code></em></p>
<p>Passed as <code class="code">len</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.25"></a><h3>prepend-unichar</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:prepend-unichar self wc))
</pre></div>
<p>Converts a Unicode character into UTF-8, and prepends it
to the string.</p>
<div class="refsect3">
<a name="id-1.1.62.3.25.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>a <span class="type">GString</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>wc</p></td>
<td class="parameter_description">
<p>a Unicode character</p>
<p>Passed as <code class="code">wc</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.26"></a><h3>replace</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:replace self find replace limit))
</pre></div>
<p>Undocumented</p>
<div class="refsect3">
<a name="id-1.1.62.3.26.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>find</p></td>
<td class="parameter_description">
<p></p>
<p>Passed as <code class="code">find</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>replace</p></td>
<td class="parameter_description">
<p></p>
<p>Passed as <code class="code">replace</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>limit</p></td>
<td class="parameter_description">
<p></p>
<p>Passed as <code class="code">limit</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.27"></a><h3>set-size</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:set-size self len))
</pre></div>
<p>Sets the length of a <span class="type">GString</span>. If the length is less than
the current length, the string will be truncated. If the
length is greater than the current length, the contents
of the newly added area are undefined. (However, as
always, string-&gt;str[string-&gt;len] will be a nul byte.)</p>
<div class="refsect3">
<a name="id-1.1.62.3.27.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>a <span class="type">GString</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>len</p></td>
<td class="parameter_description">
<p>the new length</p>
<p>Passed as <code class="code">len</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.28"></a><h3>truncate</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:truncate self len))
</pre></div>
<p>Cuts off the end of the GString, leaving the first <em class="parameter"><code>len</code></em> bytes.</p>
<div class="refsect3">
<a name="id-1.1.62.3.28.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>a <span class="type">GString</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>len</p></td>
<td class="parameter_description">
<p>the new size of <em class="parameter"><code>string</code></em></p>
<p>Passed as <code class="code">len</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.62.3.29"></a><h3>up</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (string:up self))
</pre></div>
<p>Converts a <span class="type">GString</span> to uppercase.</p>
<div class="refsect3">
<a name="id-1.1.62.3.29.4"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description">
<p>a <span class="type">GString</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>
